import React, { useState } from 'react';
import ReactDom from 'react-dom';
// class App extends React.Component {
//   state = {};
//   render() {
//     return <div>你好</div>;
//   }
// }

const App = () => {
  const [count, onCount] = useState(0);
  const [mag, onMag] = useState(' ');
  return (
    <div>
      你好
      {count}
      <button onClick={() => onCount(count + 1)}>按钮</button>
      你好
      {mag}
      <button onClick={() => onMag(mag + '~')}>按钮</button>
    </div>
  );
};

ReactDom.render(<App />, document.getElementById('root'));
